package ro.isdc.vms.vehicleadvertisement.batch.listeners;

import java.util.List;

import org.springframework.batch.core.ItemWriteListener;

import ro.isdc.vms.vehicleadvertisement.domain.VehicleAdvertisement;

/**
 * An Item Write Listener implementation.
 * 
 * @author Andrei.Chirila / ISDC! Romania
 * @version 1.0.0
 * @date Jul 20, 2009
 */
public class DeleteFlaggedAdsItemWriteListener implements ItemWriteListener<VehicleAdvertisement>{

  /**
   * {@inheritDoc}
   */
  public void afterWrite(final List<? extends VehicleAdvertisement> ads) {
    System.out.println(ads.size() + " ads have been deleted successfully...");
  }

  /**
   * {@inheritDoc}
   */
  public void beforeWrite(final List<? extends VehicleAdvertisement> ads) {
    System.out.println(ads.size() + " ads are preparing to be deleted...");
  }

  /**
   * {@inheritDoc}
   */
  public void onWriteError(final Exception exception,
      final List<? extends VehicleAdvertisement> ads) {
   System.out.println("Oops...I did it again!"); 
  }

}
